package cn.kow.kmall.core.jpa.annotion;

import cn.kow.kmall.core.jpa.QueryOperatorEnum;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * @Author: lijun
 * @Description:
 * @Date: Created in 2020-04-17 15:00
 * @Modified By: 查询条件
 */
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.FIELD)
public @interface QueryCondition {

    // 数据库中字段名,默认为空字符串,则Query类中的字段要与数据库中字段一致
    String column() default "";

    // equal, like, gt, lt...
    QueryOperatorEnum operator() default QueryOperatorEnum.equal;

    // object是否可以为null
    boolean nullable() default false;

    // 字符串是否可为空
    boolean emptiable() default false;
}
